package com.jintian.smart.kernel.module;

import lombok.Data;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;

import java.util.List;
import java.util.Map;

public interface Model {
    public static final String PROPERTY_MODEL_NAME = "smart.model.name";
    public static final String PROPERTY_SMART_MASTER = "smart.masterContext";

    String getName();

    boolean isDev();

    String getBeetlTemplatesPath();

    String getBeetlViewSuffix();

    List<Mapper> getMappers();

    String getComponentScan();

    ClassLoader getClassLoader();

    ApplicationContext getModelContext();

    ApplicationContext getParentContext();

    ResourceLoader getResourceLoader();

    Map<String, Resource[]> getResourceHandlerLocations();

    void init();

    void start();

    void stop();

    void restart();

    String getVersion();

    String getSourceCodeBasePackage();

    String getSourceCodeRoot();

    @Data
    static class Mapper {
        String dataSource;
        String packages;
        String suffix;
    }
}
